import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import MobileLoginView from '../views/MobileLoginView.vue'
import MobileForgotPasswordView from '@/views/MobileForgotPasswordView.vue'
import MobileRegisterView from '../views/MobileRegisterView.vue'
import ModileProfileView from '../views/MobileProfileView.vue'
import MobileTaskListView from '../views/MobileTaskListView.vue'
import MobileTaskDetailView from '../views/MobileTaskDetailView.vue'
import MobileTaskPublishView from '@/views/MobileTaskPublishView.vue'
import MobilePaymentView from '@/views/MobilePaymentView.vue'
import MobileOrdersView from '@/views/MobileOrdersView.vue'
import MobileOrderDetailView from '@/views/MobileOrderDetailView.vue'
import MobileWalletView from '@/views/MobileWalletView.vue'
import MobileRatingView from '@/views/MobileRatingView.vue'
import MobileMyRatingView from '@/views/MobileMyRatingView.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/Mlogin',
    name: 'Mlogin',
    component: MobileLoginView
  },
  {
    path: '/Mforgot-password',
    name: 'Mforgot-password',
    component: MobileForgotPasswordView
  },
  {
    path: '/Mregister',
    name: 'Mregister',
    component: MobileRegisterView
  },
  {
    path: '/Mprofile',
    name: 'Mprofile',
    component: ModileProfileView
  },
  {
    path: '/Mtasklist',
    name: 'Mtasklist',
    component: MobileTaskListView
  },
  {
    path: '/task-detail/:id',
    name: 'task-detail',
    component: MobileTaskDetailView,
    props: true
  },
  {
    path: '/task-publish',
    name: 'task-publish',
    component: MobileTaskPublishView
  },
  {
    path: '/payment/:orderId',
    name: 'payment',
    component: MobilePaymentView,
    props: true
  },
  {
    path: '/Morders',
    name: 'orders',
    component: MobileOrdersView
  },
  {
    path: '/order-detail/:id',
    name: 'order-detail',
    component: MobileOrderDetailView,
    props: true
  },
  {
    path: '/Mwallet',
    name: 'Mwallet',
    component: MobileWalletView
  },
  {
    path: '/rate-order/:orderId',
    name: 'rate-order',
    component: MobileRatingView,
    props: true
  },
  {
    path: '/my-ratings',
    name: 'my-ratings',
    component: MobileMyRatingView,
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
